<?php
class HomeController extends Controller {
	
	public function index() {
		$smaryt = $this->getSmarty ();
		$this->smarty->display ( "home.tpl" );
	}
	
	public function getSource() {
		require_once SERVICE . DS . "ResourceService.class.php";
		$common = new ResourceService ( $this->getDB () );
		$data = $common->getResources ();
		
		
		print json_encode($data);
// 		$Return = "<sources>";
// 		foreach ( $data as $re ) {
// 			$Return .= "<source>".
// 			"<device_name>" . $re->DEVICE_NAME . "</device_name>".
// 			"<device_id>" . $re->DEVICE_ID . "</device_id>".
// 			"<satellite>" . $re->SATELLITE . "</satellite>".
// 			"<work_type>" . $re->WORK_TYPE . "</work_type>".
// 			"<status>" . $re->SATELLITE . "</status>".
			
// 			"</source>";
// 		}
// 		$Return .= "</sources>";
// 		print ($Return) ;
	}
}